// --------------------------------------------------------------------------------------------------------------------
// <copyright file="TraceMessageFactory.cs" company="AzureContrib (Open source library http://azurecontrib.codeplex.com)">
//   Microsoft Public License (Ms-PL)
// </copyright>
// <summary>
//   A <see cref="ITraceMessageFactory"/> that creates <see cref="TraceMessage"/> instances.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace AzureContrib.WindowsAzure.Diagnostics
{
	/// <summary>
	/// A <see cref="ITraceMessageFactory"/> that creates <see cref="TraceMessage"/> instances.
	/// </summary>
	public class TraceMessageFactory : ITraceMessageFactory
	{
		/// <summary>
		/// Creates an instance of a <see cref="TraceMessageBase"/>.
		/// </summary>
		/// <param name="category">Category to trace to.</param>
		/// <param name="switch">Switch name of the current trace target.</param>
		/// <param name="message">The Message to trace.</param>
		/// <returns>A <see cref="TraceMessage"/> with the supplied data.</returns>
		public TraceMessageBase Create(string category, string @switch, string message)
		{
			return new TraceMessage(category, @switch, message);
		}

		/// <summary>
		/// Creates an instance of a <see cref="TraceMessageBase"/>.
		/// </summary>
		/// <param name="level"><see cref="LogLevel"/> to trace to.</param>
		/// <param name="switch">Switch name of the current trace target.</param>
		/// <param name="message">The Message to trace.</param>
		/// <returns>A <see cref="TraceMessage"/> with the supplied data.</returns>
		public TraceMessageBase Create(LogLevel level, string @switch, string message)
		{
			return new TraceMessage(level, @switch, message);
		}
	}
}